package com.mydemo.design_pattern.action_type.memento_pattern;

/**
 * <p></p >
 *
 * @author liming1
 * @version $Id: Originator, v1.0 2019-09-23 14:31 liming1 Exp $
 */
public class Originator {
    private String state;

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Memento saveStateToMemento(){
        return new Memento(this.state);
    }

    public void getStateFromMemento(Memento memento){
        state = memento.getState();
    }

}
